
package kvsnode;

import java.io.Serializable;

/**
 * POJO message format which is supposed to be sent from a node to another node.
 * 
 */

public class RemoteMessage implements Serializable
{
  /**
   * A message id for the message. This is needed to match it to the message table in the node.
   */
  private String my_message_id;
  
  /**
   * The message sent from a node to another.
   */
  private Object my_message;
    
  /**
   * A constructor.
   * 
   * @param the_message_id a message id.
   * @param the_message a message itself.
   */
  public RemoteMessage(final String the_message_id, final Object the_message)
  {
    my_message_id = the_message_id;
    my_message = the_message;
  }

  /**
   * A getter for a message id.
   * 
   * @return a message id.
   */
  public String getMessageId()
  {
    return my_message_id;
  }

  /**
   * A setter for a message id.
   * 
   * @param the_message_id set the message id.
   */
  public void setMessageId(final String the_message_id)
  {
    my_message_id = the_message_id;
  }

  /**
   * A getter for a message.
   *  
   * @return a message.
   */
  public Object getMessage()
  {
    return my_message;
  }

  /**
   * A setter for a message.
   * 
   * @param the_message a message from other node.
   */
  public void setMessage(final Object the_message)
  {
    this.my_message = the_message;
  }

}
